<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //第一题
      //   function sayHi() {
      //     console.log(name); //undefined
      //     console.log(age); //ReferenceError: Cannot access 'age' before initialization
      //     var name = "Lydia";
      //     let age = 21;
      //   }
      //   sayHi();
      //第二题
      //   for (var i = 0; i < 3; i++) {
      //     setTimeout(() => console.log(i), 1);//3，3，3
      //   }
      //   for (let i = 0; i < 3; i++) {
      //     setTimeout(() => console.log(i), 1);//0，1，2
      //   }
      //第三题
      // const shape = {
      //   radius: 10,
      // diameter() {
      //   return this.radius * 2;
      // },
      // perimeter: () => 2 * Math.PI * this.radius,
      // perimeter: function () {
      //   2 * Math.PI * this.radius;
      //   console.log(this);
      // },
      //   };
      //   shape.perimeter();
      //   console.log(shape.diameter()); //普通函数，this指向调用时对象(也可以说指向上一层)  this.radius==shape.radius
      //   console.log(shape.perimeter()); //箭头函数，this指向与上一层的this指向一致  this.radius==window.radius
      //第四题
      console.log("wudi");
      console.log(!"无敌");
    </script>
  </body>
</html>
